I’ve been asking about this - and I think I figured it out today, so here goes.
This uses “integrated composer”, so, “normal” out of the box Drupal installs on Github.
I’m leaving out some details, but the basics are…
-
You want to crate your drupal site in the Pantheon dashboard as normal and initialize the site for the first time on the DEV environment. (by initialize, I mean complete the install.php process).
-
git clone the pantheon repo to your localhost.
-
Create an empty github repo.
-
Add the github repo as a remote on your localhost.
-
Rename the pantheon repo as “pantheon” and the github repo as “origin”, This just simpifies keeping straight what’s “origin” and what’s not…
From here on out you are NOT pushing to Pantheon’s repo, ever… all work goes through Github.
- In your project
.gitignore
file,
But something like this, at the top : https://gist.github.com/alphex/6fba44d6a5f56f3768c6b65632f59caf.
In my project, this is literally the first 6 lines of the .gitignore file.
THEN, follow this guide https://medium.com/swlh/pantheon-and-github-actions-automated-deployments-via-github-actions-c245aa954797 to set up the basic structure of your workflows.
I’ve made some changes based on this example https://medium.com/bluecadet/pantheon-and-github-actions-1b9b1dbd5746
Which I’ve created in these two workflow files.
These two files handle pushing branches to github, which syncronizes them to pantheon in near real time, after the Actions fire.
This will let you create multidevs based on the branches on the pantheon dashboard (or via Terminus) since the branch is syncronzied to Pantheon when you push to Github.
Any additional pushes to that branch, will go to pantheon as well.
You handle your merges in github, and the main branch gets pushed to master.
I hope this helps!